package util;

public class Check {
    //    校验登录名
    public static boolean checkLoginName(String login_name) {
        String reg = "^[0-9a-zA-Z_]+$";
        if (null != login_name && login_name.matches(reg)) {
            return true;
        }
        return false;
    }

    //校验邮箱
    public static boolean checkEmail(String email) {
        String reg = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$";
        if (null != email && email.matches(reg)) {
            return true;
        }
        return false;
    }
}
